<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script>
	function myFunction(form) {
		alert("Submit your exam: " + document.test.size.value);
		for ( var j = 1; j <= document.test.size.value; j++) {
			var radios = document.getElementsByName(j);

			for ( var i = 0, length = radios.length; i < length; i++) {
				if (radios[i].checked) {
					alert(radios[i].value);
				}
			}
		}
		return false;

	}
</script>
</head>
<body>
	testing,
	<br />
	<form name="test" onsubmit="return myFunction(this);">
		<input type="hidden" name="size" value="${fn:length(listImgQuestion)}" />
		<c:forEach items="${listImgQuestion}" var="imgQuestion">

			<br />
			<c:out value="${imgQuestion.media_id}.jpg" />
			<br />
			<img
				src="<c:out value="resources/images/${imgQuestion.media_id}.jpg"/>"
				width="200" height="200">

			<audio controls> <source src="<c:out value="resources/audio/${imgQuestion.media_id}.mp3"/>" type="audio/mpeg">
			Your browser does not support the audio element. </audio>
		</c:forEach>
		<br /> <input type="submit" value="Submit" />
	</form>
</body>
</html>